﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WeatherPush
{
    internal class Phone : Device
    {
        public string PhoneNumber { get; set; }

        public override void Update(Data data)
        {
            if (data is WeatherData weatherData)
            {
                Console.WriteLine($"号码为 {PhoneNumber} 的手机收到最新气象数据：[温度：{weatherData.Temperature}，湿度：{weatherData.Humidity}，气压：{weatherData.Pressure}]");
            }
            else if (data is TrafficData trafficData)
            {
                Console.WriteLine($"号码为 {PhoneNumber} 的手机收到最新交通数据：[街道：{trafficData.Street}，状态：{trafficData.Status}]");
            }
        }
    }
}
